<?php

/**
 * 
 * 模块
 * @author Administrator
 *
 */
class Site_Models_Model extends Fengqiaoju_Db_Table {

	public function __construct() {

		parent::__construct ();
		$this->_name = $this->_prefix . "site_model";
		$this->_primary = "model_id";
	}

	/**
	 * 获取模块信息
	 */
	public function getModelInfo($model_id , $model_seo_name = '' , $site_seo_name = '') {

		if ($model_seo_name && $site_seo_name) {
			$where = "model_seo_name='$model_seo_name' AND site_seo_name='$site_seo_name'";
		}
		else {
			$where = 'model_id="' . $model_id . '"';
		}
		
		$order = '';
		return $this->fetchRow ( $where, $order );
	}

	/**
	 * 获取小站的模块
	 * @param int $site_id 小站id
	 * @param string $site_seo_name 小站二级域名
	 */
	public function getModelList($where , $order = '' , $count = '' , $offset = '') {

		$where = $this->arrayToString ( $where );
		return $this->fetchAll ( $where, $order, $count, $offset );
	}
}
?>